//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
  },
  //事件处理函数
  userCenter: function () {
    console.log("userCenter....")
    wx.navigateTo({
      url: '../userCenter/userCenter'
    })
  },
  transDetail: function () {
    wx.navigateTo({
      url: '../transDetail/transDetail'
    })
  },
  topupCenter: function () {
    wx.navigateTo({
      url: '../topupCenter/topupCenter'
    })
  },
  onLoad: function () {
    if (app.globalData.openid) {
      wx.request({
        url: "https://kuaifu.boshukeji.com/api/userInfo/weChat/get",
        data: {
          appid: "wx0c6ddc854ee29b49",
          openid: app.globalData.openid
        },
        success: res => {
          console.log(res)
          if (res.data.result) {
            app.globalData.userInfo = res.data.data
            console.log(app.globalData.userInfo)
          }else{
            //绑定用户。
            

          }
        }
      })
    }
  }
})
